package com.travelms.service.commonuserpage;

import com.travelms.pojo.Sale;
import com.travelms.dao.DBFind;

import java.io.IOException;
import java.sql.SQLException;
import java.util.Scanner;

public class LookOrderInfo {
    private DBFind dbFind = new DBFind();
    Scanner sc = new Scanner(System.in);
    public LookOrderInfo(String username) throws SQLException, IOException {
        Sale info =  dbFind.findOrderInfo(username);
        if (info == null){
            System.out.println("该用户没有订购记录");
            System.out.println("按任意键退出");
            String n = sc.nextLine();
        }else {
            System.out.println("您的订购信息如下：");
            System.out.println(info);
            System.out.println("按任意键退出");
            String n = sc.nextLine();

        }
    }
}
